package com.作业.第十章作业.Homework02;

/**
 * 作    者 ：吾路巴尼
 * 创建时间 ：2025/2/13-18:40
 */
public class main {
    public static void main(String[] args) {
        System.out.println(Frock.getNextNum());//100
        System.out.println(Frock.getNextNum());//200
        Frock f1 = new Frock();
        System.out.println(f1.getSerialNumber());//300
        Frock f2 = new Frock();
        System.out.println(f2.getSerialNumber());//400
        Frock f3 = new Frock();
        System.out.println(f3.getSerialNumber());//500
    }
}

class Frock{
    private static int currentNum = 100000;
    private int serialNumber;
    public static int getNextNum(){
        currentNum += 100;
        return currentNum;
    }

    public int getSerialNumber() {
        return serialNumber;
    }

    public Frock() {
        this.serialNumber = getNextNum();
    }
}